let { observable, observe, computed, autorun, when, reaction } = require("mobx");

class Person {
    @observable name = "js";
    @observable age = 9;
    @observable list = {
        id: "1",
        name: "2"
    }
    //手机号拼接
    @observable area = "010";
    @observable photo = "15945789456";

    @computed get home() {
        return this.area + "_" + this.photo
    }

}
let p1 = new Person();

//监听数据变化，数据当变化时，监听
 reaction(()=>[p1.age, p1.name], arr => {
    console.log(arr)
})
p1.name = "html";
p1.age = 45